-- want_diamond
-- created by panyl
-- 神龙许愿：我要获得钻石

return {
    doWish = function(info)
        local args = DragonWishM.query(info["id"], "args");
        local unrealId = args["unreal"];

        local wishInfo = ME.user.dbase:query("wish_info", {});
        local record = wishInfo["all_new"];

        -- 老用户之前许愿过，不再出现第一个矿脉
        if DragonWishM.getOptionTimesById(info["id"]) > 0 and record == nil then
             unrealId = args["unreal2"];
        elseif DragonWishM.isDiamondMineOver() then
            -- 开采完了也是第二个
            unrealId = args["unreal2"];
        elseif DragonWishM.getOptionTimesById(info["id"]) == 0 then
            -- 标记下新来的
            wishInfo["all_new"] = 1;
            ME.user.dbase:set("wish_info", wishInfo);
        end

        -- 开始夹层迷宫
        UnrealDungeonM.startDungeon(unrealId);
    end,
};
